var SpellFreeze = function() {
    this.processSpell = function(rcs, cnxs, ns){
       for(var cnxIndex in cnxs){
           var cnx = cnxs[cnxIndex];
           for(var transIndex in cnx.getCurrentTranslations()){
               var trans = cnx.getCurrentTranslations()[transIndex];
               trans.getPacket().setSpeed(20);
           }
       }
    };
    this.costInMana = function(){
        return 20;
    };
};

var SpellAddPVResearchCenter = function(){
    this.processSpell = function(rcs, cnxs, ns){
        for(var rcsIndex in rcs){
            var rc = rcs[rcsIndex];
            rc.setHealth(rc.getHealth() + (rc.GetMaxHealth()/2));
        }
    };
    this.costInMana = function(){
        return 40;
    };
};

var SpellAddPVPacket = function(){
    this.processSpell = function(rcs, cnxs, ns){
        for(var cnxIndex in cnxs){
           var cnx = cnxs[cnxIndex];
           for(var transIndex in cnx.getCurrentTranslations()){
               var trans = cnx.getCurrentTranslations()[transIndex];
               trans.getPacket().setHealth(trans.getPacket().getHealth() + 5);
           }
       }
    };
    this.costInMana = function(){
        return 30;
    };
};

var SpellKnowledgeColourless = function(){
    this.processSpell = function(rcs, cnxs, ns){
        for(var cnxIndex in cnxs){
           var cnx = cnxs[cnxIndex];
           for(var transIndex in cnx.getCurrentTranslations()){
               var trans = cnx.getCurrentTranslations()[transIndex];
               trans.getPacket().setType(0);
           }
       }
    };
    this.costInMana = function(){
        return 70;
    };
};